﻿<UserControl x:Class="Silverlight.Tester.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Controls="clr-namespace:Silverlight.Controls;assembly=Silverlight.Controls"
    VerticalContentAlignment="Center" HorizontalContentAlignment="Center">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition />
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition />
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Border Grid.Column="1" Grid.Row="1" BorderBrush="Black" BorderThickness="1">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="10"/>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="60"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>

                <Border Grid.ColumnSpan="2" Background="#FF1F1F1F">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="VersionField" Foreground="#FFFFFFFF"/>
                        <TextBlock Grid.Column="1" x:Name="CodePlexLink" Cursor="Hand" Text="http://tooltipservice.codeplex.com" 
                                   Foreground="#FFFFFFFF" HorizontalAlignment="Right"
                                   MouseEnter="OnLinkMouseEnter" MouseLeave="OnLinkMouseLeave" MouseLeftButtonUp="OnLinkMouseLeftButtonUp">
                            <Controls:ToolTipService.ToolTip>
                                <Controls:ToolTip ShowDuration="15" InitialDelay="0" x:Name="CodePlexLinkToolTip">
                                    <TextBlock Text="Click to go to the CodePlex site to find out more." />                                    
                                </Controls:ToolTip>
                            </Controls:ToolTipService.ToolTip>
                        </TextBlock>
                    </Grid>
                </Border>

                <TextBlock Grid.Row="2" TextWrapping="Wrap">
                    <Run Text="Hover the green button to display a tooltip with data bound values for 10 seconds after a delay of 3 seconds."/>
                    <LineBreak/>
                    <Run Text="The tooltip will fade out by default during 0.75 seconds (configurable)."/>
                    <LineBreak/>
                    <Run Text="Click the button to"/>
                    <Run FontStyle="Italic" Text="disable"/>
                    <Run Text="the button."/>
                </TextBlock>
                <!-- BEGIN SETTING TOOLTIP IN XAML -->
                <Button x:Name="GreenButton" Click="OnButtonClick" Grid.Row="2" Grid.Column="1" Background="Green" 
                        Content="Green button" MouseEnter="OnButtonMouseEnter" MouseLeave="OnButtonMouseLeave">
                    <Controls:ToolTipService.ToolTip>
                        <Controls:ToolTip ShowDuration="10" InitialDelay="3" x:Name="greenTooltip">
                            

                            <StackPanel Margin="5" >

                                <TextBlock Text="This tooltip will last for 10 seconds." />
                                <TextBlock Text="The first and last names are data bound." />
                                                                
                                <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                                    <TextBlock Text="First Name: "
                                               FontWeight="Bold"
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center" />
                                    <TextBlock Text="{Binding Path=FirstName}"                                               
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center" />
                                </StackPanel>

                                <StackPanel Orientation="Horizontal"
                                            Margin="0,0,0,0">
                                    <TextBlock Text="Last Name: "
                                               FontWeight="Bold"
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center" />
                                    <TextBlock Text="{Binding Path=LastName}"
                                               HorizontalAlignment="Center"
                                               VerticalAlignment="Center" />
                                </StackPanel>
                            </StackPanel>
                            
                        </Controls:ToolTip>
                    </Controls:ToolTipService.ToolTip>
                </Button>
                <!-- END SETTING TOOLTIP IN XAML -->

                <TextBlock Grid.Row="4" TextWrapping="Wrap">
                    <Run Text="Hover the red button to display a persistent tooltip immediately."/>
                    <LineBreak/>
                    <Run Text="Click the button to"/>
                    <Run FontStyle="Italic" Text="disable"/>
                    <Run Text="the button."/>
                </TextBlock>
                <Button Grid.Row="4" x:Name="RedButton" Click="OnButtonClick" Grid.Column="1" Background="Red" 
                        Content="Red button" MouseEnter="OnButtonMouseEnter" MouseLeave="OnButtonMouseLeave">
                </Button>               
               
                
                <StackPanel Grid.Row="6" Grid.ColumnSpan="2" >
                    <TextBlock x:Name="labelDelay" Text=" " HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <TextBlock x:Name="labelDuration" Text=" " HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <Button Width="200" x:Name="buttonEnableButtons" Click="OnEnableButtonsClick" Content="Re-enable buttons"/>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
